#ifndef __GENERATOR_H__
#define __GENERATOR_H__

#include "parser.h"
#include "rarray.h"
#include "rstring.h"
#include "redobject.h"
#include "bytecode_buffer.h"

typedef struct _generator_t
{
	rarray_t			 free;
	rarray_t			 names;
	rstring_t			*fname;
	rstring_t			*source;
	RedObject			*module;
	RedObject			*consts;
	rarray_t			 breaks;
	rarray_t			 continues;
	bytecode_buffer_t	*current_buffer;
} generator_t;

RED_EXPORT RedObject *generator_generate(compond_t *ast, rstring_t *fname, rstring_t *source, RedObject *module, RedObject *consts);

#endif /* __GENERATOR_H__ */
